package com.ly.pj.common.pojo;

/**
 * 基于此对象封装客户端响应到客户端的数据
 */
public class ResponseResult {
    /*响应状态码（有的人用code） 1表示ok，0表示error，...*/
    private Integer state=1;
    /*状态码对应的信息*/
    private String massage="ok";
    /*正确的响应数据*/
    private Object data;

    public ResponseResult(){}

    public ResponseResult(String massage) {//new ResponseResult("delete ok");
        this.massage = massage;
    }
    public ResponseResult(Object data){//new ResponseResult(list);
        this.data=data;
    }
    public ResponseResult(Throwable e){//new ResponseResult(e);
        this.state=0;
        this.massage=e.getMessage();
    }

    public Integer getState() {return state;}

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMassage() {
        return massage;
    }

    public void setMassage(String massage) {
        this.massage = massage;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
